package com.dailyblue.java.spring.boot.mvc.simple.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/first")
public class FirstController {
    @RequestMapping("/a")
    @ResponseBody
    public String a() {
        System.out.println("FirstController`a method!");
        return "This is FirstController`a method!";
    }

    @RequestMapping("/b")
    @ResponseBody
    public String b(String name) {
        System.out.println("FirstController`b method!params:" + name);
        return "This is FirstController`b method!params:" + name;
    }

    @RequestMapping(value = "/c", method = RequestMethod.POST)
    @ResponseBody
    public String c(String name) {
        System.out.println("FirstController`c method!params:" + name);
        return "This is FirstController`c method!params:" + name;
    }

}
